home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 25
/
Cream of the Crop 25.iso
/
bbs
/
mhis020.zip
/
CALLLIST.MEX
< prev
next >
Wrap
Text File
|
1996-12-09
|
4KB
|
129 lines
#include <max.mh>
#include "wildcard.mh"
#include "general.mh"
#include "findchar.mh"
#include "date.mh"
#include "callers.mh"
#include "callinfo.mh"
#include "callcrit.mh"
#include "callutil.mh"
#include "file.mh"
#include "upchar.mh"
#define LEGEND_FILE "history\\listlgnd"
#define FLAGS_FILE "history\\flags"
#define HELP_FILE "history\\listkeys"
#define SPINNER_FILE "history\\spinner"
int: more_count;
int custom_more () {
char: key;
more_count := more_count + 1;
if (more_count >= usr.len - 1) {
more_count := 0;
for (;;) {
print (COL_LBLUE, "More ", COL_YELLOW, "[Y,n,l,f,?=help]: ");
while (kbhit ()) getch ();
show_file (SPINNER_FILE);
key := getch ();
print (COL_CYAN, key,'\n');
key := upChar (key);
if (key = 'N') {return False;}
else if (key = 'L') {show_file (LEGEND_FILE);}
else if (key = 'F') {show_file (FLAGS_FILE);}
else if (key = '?') {show_file (HELP_FILE);}
else if ((key = 'Y') or (key = '\r')) {return True;}
else print ("Sorry... unknown command: ", key, '\n');
};
};
return True;
}
void show_list () {
long: calls;
struct _callinfo: ci;
int: last_day;
calls := call_numrecs();
// callers.index := callers.index;
print(COL_WHITE "Call# Name Node Calls Login Min Up Dn Wr Rd Pg Flags\n"
"────── ───────────────────────── ──── ───── ───── ─── ── ── ── ── ── ─────\n");
// callers.index := first_caller_index ();
more_count := 2;
while ( (callers.index >= 0 or (callers.forward_search = True))
AND (callers.index < calls or (callers.forward_search = False))
AND call_read(callers.index, ci)
AND kbhit () = False) {
if (meets_criteria (ci, callers.criteria)) {
if (ci.logoff.date.day <> last_day) {
print (COL_DKGRAY, strpad (" " + COL_GRAY + date_string (ci.logoff.date) + " ",
usr.width - 1,'─'), '\n');
if (custom_more () = False) return;
last_day := ci.logoff.date.day;
};
print (COL_WHITE, callers.index);
while (sys.current_col < 8) {
print (' ');
};
print(COL_LCYAN, strpad(ci.name,25,' '),
COL_LMAGENTA, strpadleft(itostr(ci.task),5,' '),
COL_LRED, strpadleft(itostr(ci.calls),6,' '), ' ',
COL_YELLOW, strpad(time_to_string(ci.login.time),6,' '),
COL_WHITE, strpadleft (itostr (time_online (ci) / 60), 3, ' '),
COL_LCYAN, strpadleft(itostr (ci.filesup), 3, ' '),
COL_LBLUE, strpadleft(itostr (ci.filesdn), 3, ' '),
COL_YELLOW, strpadleft(itostr (ci.posted), 3, ' '),
COL_LRED, strpadleft(itostr (ci.read), 3, ' '),
COL_MAGENTA, strpadleft(itostr (ci.paged), 3, ' '), ' ',
COL_LBLUE, strpad(flag_string (ci.flags), 5, ' '),
'\n');
if (custom_more () = False) return;
}
else {
print (COL_WHITE, callers.index);
print (" \x0d");
vidsync ();
};
if (callers.forward_search) {
callers.index := callers.index + 1;
}
else {
callers.index := callers.index - 1;
};
}
if (kbhit ()) {
print (COL_WHITE + "Aborted\n");
while (kbhit ()) getch ();
};
if (callers.index >= calls or callers.index < 0) {
print (COL_WHITE + "End of callers log\n");
};
}
void main() {
string: result;
read_callers ();
id.instant_video := 0;
if (call_open()) {
input_str (result, INPUT_NLB_LINE + INPUT_DEFAULT, 0, 80,
COL_WHITE + "\nEnter call number, date, '=' for current, or <enter> for first: " + COL_CYAN);
callers.index := caller_index (result);
show_list ();
call_close();
}
else {
print ("Cannot open callers.dat!!\n");
};
write_callers ();
}